package cn.gson.crm.controller;

import cn.gson.crm.model.pojos.Outbound;
import cn.gson.crm.model.pojos.StockDetails;
import cn.gson.crm.model.pojos.WaouDetails;
import cn.gson.crm.model.pojos.Warehousing;
import cn.gson.crm.model.service.OutboundService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/OutboundController")
public class OutboundController {
    @Autowired
    OutboundService outboundService;
    @RequestMapping("/ContractMethod")
    @ResponseBody
    public void updatesave(@RequestBody Outbound outbound){
        outboundService.updatsave(outbound);
    }
    @RequestMapping("/ContractMethoddd")
    @ResponseBody
    public void save(@RequestBody Outbound outbound){
        outboundService.save(outbound);
    }
    @RequestMapping("/ContractMethod2")
    @ResponseBody
    //查询当前登录人查询所有出库单
    public Map<String,Object> selectck(HttpSession session, Integer yid, Integer page, Integer size){
        return outboundService.selectck(session,yid,page,size);

    };
    @RequestMapping("/ContractMethod3")
    @ResponseBody
    //时间查询
    public Map<String,Object> selecttime(HttpSession session,Integer yid,  String statr,  String endtime,Integer page,Integer size){
        return outboundService.selecttime(session,yid,statr,endtime,page,size);
    };
    @RequestMapping("/ContractMethod4")
    @ResponseBody
    //条件查询
    public Map<String,Object> selectwhere(HttpSession session,Integer yid, String where,Integer page,Integer size){
        return outboundService.selectwhere(session,yid,where,page,size);
    };
    @RequestMapping("/ContractMethod5")
    @ResponseBody
    //修改状态
    public void updateout(Integer oid){
        outboundService.updateout(oid);
    };
    @RequestMapping("/ContractMethod6")
    @ResponseBody
    //减库存数量
    public void updatekucun(Integer oid){
        outboundService.updatekucun(oid);
    }
}
